package com.yuhanginfo.modules.web.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.yuhanginfo.common.persistence.Page;
import com.yuhanginfo.common.service.WebCrudService;
import com.yuhanginfo.common.utils.ReadProperties;
import com.yuhanginfo.modules.web.dao.WebOrdersDao;
import com.yuhanginfo.modules.web.entity.WebOrders;

@Service
@Transactional(readOnly = true)
public class OrderService extends WebCrudService<WebOrdersDao, WebOrders>{
      @Autowired
      private WebOrdersDao ordersDao;
      public List<WebOrders> myOrderList(WebOrders webOrders){
    	  return ordersDao.myOrderList(webOrders);
      }
	public Page<WebOrders> myOrderPage(Page<WebOrders> page,WebOrders webOrders){
		String pageSize = ReadProperties.ReadByName("page.webPageSize");
		page.setPageSize(Integer.parseInt(pageSize));
		webOrders.setPage(page);
		page.setList(ordersDao.myOrderList(webOrders));
		return page;
	}
	public String findMaxCode(String now) {
		return ordersDao.findMaxCode(now);
	}
	public WebOrders selectWebOrdersByCode(String orderCode) {
		return ordersDao.selectWebOrdersByCode(orderCode);
	}
	public WebOrders selectById(String id) {
		
		return ordersDao.selectById(id);
	}
	@Transactional(readOnly = false)
	public void cancelOrder(WebOrders orders) {
		ordersDao.cancelOrder(orders);
		
	}
	public List<WebOrders> selectMyStoreList(String string) {
		
		return ordersDao.selectMyStoreList(string);
	}
	public List<WebOrders> myPhoneList(WebOrders orders) {
		
		return ordersDao.myPhoneList(orders);
	}
	public List<WebOrders> selectPhoneList(Map<String, Object> map) {
		
		return ordersDao.selectPhoneList(map);
	}
}
